home *** CD-ROM | disk | FTP | other *** search
/ The 640 MEG Shareware Studio 2 / The 640 Meg Shareware Studio CD-ROM Volume II (Data Express)(1993).ISO / comm / commo54.zip / SAMPLES.MAC < prev    next >
Text File  |  1992-12-19  |  8KB  |  196 lines

  1.                   ┌───────────────────────────┐
  2.                   │ Additional Macro Examples │
  3.                   └───────────────────────────┘
  4.  
  5. This file contains a number of sample macros.  Feel free to copy any of them
  6. to COMMO.MAC and to alter them to your own needs.  Additions will be made to
  7. this file as time permits.  Thanks to the users for their contributions.
  8.  
  9. {COMMO} macros can be made to do many amazing things besides just logging into
  10. BBS's and doing mail runs (those are indeed popular functions, however).  Some
  11. of the simplest macros demonstrate this capability.
  12.  
  13.  
  14. The first two macros are used for reading messages.  They use the grey plus
  15. and minus keys in the lower right corner of the keyboard. The first one sends
  16. a <cr>, then clears the screen.  Makes messages a lot easier to read since
  17. each one starts displaying at the top of the screen.  The second macro just
  18. sends a <cr>.  Nice for keyboards without the extra Enter key.
  19.  
  20.  Message reading macros
  21.  ───────────────────────────────────────────────────────────────────────────
  22.  {:gr+} {send |} {clear} {}
  23.  {:gr-} {send |} {}
  24.  
  25.  
  26. The next macro is a very important one.  It shows the basic method of asking
  27. for a filename and uploading the file.  Notice that it first sets the variable
  28. "file" to the upload directory (the variable "uldir").  Then when the INPUt
  29. function executes, the upload directory appears in the input line with a "\".
  30. This macro would execute when Alt-F2 is pressed.
  31.  
  32.  Upload a file using Zmodem (via DSZ)
  33.  ───────────────────────────────────────────────────────────────────────────
  34.  {:af2} {setv file,%uldir\}
  35.         {input file,Enter a filename:}
  36.         {exec-AW DSZ port %_por sz -m %file} {}
  37.  
  38.  
  39.  Start my mail reader after a mail run
  40.  ───────────────────────────────────────────────────────────────────────────
  41.  {:cF3} {exec-Ns jabber} {}            JABBER Reader w/swap
  42.  
  43.  
  44. The next two utilities are used in various macros to wait for carrier detect
  45. to drop, then continue dialing (ncr) and to hangup when necessary and continue
  46. dialing (hng):
  47.  
  48.  {:hng}
  49.         {pause 3} {hangup y}
  50.  {:ncr}
  51.         {pause 1} {ifcarrier ncr}
  52.         {pause 5} {dial ,} {beep} {}
  53.  
  54.  
  55.  
  56. My generic login macro will login to most popular BBS's.  The generic login
  57. subroutine can be called from mail run macros, etc.  The GOLOok with the
  58. ";passwor" ignores the string "password" in the opening instructions on an
  59. Auntie board.  Put {login} in your Dialing Directory macro field.
  60.  
  61.  Generic login macro
  62.  ───────────────────────────────────────────────────────────────────────────
  63.  {:login} {capture y,c:\commo\commo.cap}      RBBS, PCBoard, Auntie, etc.
  64.           {asci ,} {call gls} {}
  65.  
  66.  Generic login subroutine
  67.  ───────────────────────────────────────────────────────────────────────────
  68.   {:gls} {setlook 60,hng,10,|}
  69.          {setv ss_r,~|} {setv ss_yr,~y|}
  70.   {:li1} {sslo ss_r,(enter)}            {sslo ss_yr,graphics (enter)}
  71.          {calo li1,li2,first name}      {calo li1,li3,last name}
  72.          {sslo ss_yr,is this correct}   {golo li1,;passwor}
  73.          {lookfor password}             {send ~%_pas|} {return}
  74.   {:li2} {send ~Fred|}    {return}
  75.   {:li3} {send ~Brucker|} {return}
  76.  
  77.  
  78. Here is a macro using variables to do a mail run on a PCBoard with a MarkMail,
  79. Rosemail or QMail door.  It will upload a reply packet if one exists, delete
  80. the packet if the upload is successful, then log off.  If there is no reply
  81. packet it will download new messages and log off. At the end it will wait for
  82. carrier detect to drop, then continue multi-number dialing.
  83.  
  84. The subroutines "mail_up" and "mail_dn" can be changed to use any protocol.
  85. The supplied ones use the Internal Xmodem-1k.
  86.  
  87. Four variables must be set prior to starting this macro.  These can be set in
  88. the Dialing Directory entry or in the Linked Macro.  For example, to call
  89. Northern Lights and use the QMail door, the Dialing Directory (all on one
  90. line!) would be:
  91.  
  92.   Northern Lights   12/21/91  {1 207 761 4782}  {password} {pcbmail} {} ...
  93.       ... {nodeid,nlbbs} {maildoor,qmail} {nomsgs,sorry, but no} {ptim,2}
  94.  
  95. This will set the variables and go direct to "pcbmail."
  96.  
  97. To use a Linked Macro instead you would have a Dialing Directory entry like:
  98.  
  99.   Northern Lights   12/21/91  {1 207 761 4782}  {password} {northern} {}
  100.  
  101. And then have a Linked Macro such as:
  102.  
  103.   {:northern}
  104.         {setv nodeid,nlbbs}             Set node id
  105.         {setv maildoor,qmail}           Set door type
  106.         {setv nomsgs,sorry, but no}     Set message to LOOKfor if no messages
  107.         {setv ptim,2}                   Set prompt timer duration
  108.         {goto pcbmail}                  GOTO the mail run macro
  109.  
  110.  
  111.  PCBoard generic mailrun
  112.  ───────────────────────────────────────────────────────────────────────────
  113.  {:pcbmail}
  114.          {setv ss_yr,y|}
  115.          {capt y,c:\commo\%nodeid.%_day} {asci ,}
  116.          {setl 30,hng} {look ^g} {call gls}
  117.          {setl 60,hng,%ptim,n|} {look command?}
  118.          {setl 120,hng}  ** turn off prompt timer
  119.  
  120.          {send open %maildoor|} {look %maildoor command}
  121.          {ifex %uldir\%nodeid.rep,,mr_dl}  ** if no reply, go to download
  122.  {:mr_ul}
  123.          {send u|} {look %nodeid.rep} {call mail_up}
  124.          {look %maildoor command} {ifcon mr_gb,mr_ul} ** if error, try again
  125.  {:mr_dl}
  126.          {send d|}
  127.          {golo mr_gb,%nomsgs} {sslo ss_yr,when done?}
  128.          {sslo ss_yr,(y/n)} {look %nodeid.qwk}
  129.          {call mail_dn} {look %maildoor command}
  130.          {ifcon ,mr_dl}  ** if error, try again
  131.  {:mr_gb}
  132.          {send g|} {goto hng}
  133.  
  134.  {:mail_dn} {pause 2} {rxmo %dldir\%nodeid.qwk} {comp %_err,0} {return}
  135.  
  136.  {:mail_up} {sxmo-k %uldir\%nodeid.rep} {ifer 1,mu_end}
  137.             {exec-N del %uldir\%nodeid.rep}
  138.  {:mu_end}  {comp %_err,0} {return}
  139.  
  140.  
  141. Here is my mailrun macro for Babble Underground using the MKQwk mail door
  142. under the Remote Access BBS.  The variable "dldir" is used as the disk
  143. directory for downloading the .QWK packet, "uldir" for the .REP.
  144.  
  145.  Babble Underground mail run
  146.  ───────────────────────────────────────────────────────────────────────────
  147.  {:babble}
  148.         {setv ss_y,y} {setv ss_n,n}
  149.         {setv nodeid,babble-u}  ** set board ID
  150.         {capt y,c:\commo\%nodeid.%_day} {asci ,}
  151.         {setl 60,hng}
  152.         {look escape twice} {send ^[^[}  ** for Front Door
  153.         {look real name?} {send Fred Brucker|}  <<-- Your name here
  154.         {look password:} {send %_pas|}
  155.         {sslo ss_n,y/n}
  156.         {look command:} {send q}  ** open .QWK door
  157.         {look command:}
  158.         {ifex %uldir\%nodeid.rep,,bu_dl}  ** if no reply, go to download
  159.  {:bu_ul}
  160.         {send u}
  161.         {sslo ss_y,yes/no}
  162.         {look transfer now}
  163.         {call mail_up}
  164.         {look command:} {send g~y}
  165.         {pause 2} {goto hng}
  166.  {:bu_dl}
  167.         {setl 600,hng}   ** set timeout for download
  168.         {send d}
  169.         {sslo ss_y,yes/no}
  170.         {golo hng,no messages found}
  171.         {look transfer now}
  172.         {call mail_dn}
  173.         {pause 5} {goto hng}
  174.  
  175.  
  176. Here is my online quoting macro.  It saves the Screen Image File pathname in
  177. the variable "scrsav."
  178.  
  179. Then it sets the Screen Image File to a temporary file and goes into
  180. Scrollback.  In Scrollback I write a block of text to disk (the quote), then
  181. exit.  My editor (QEdit) is then executed on the temporary file.  I do what I
  182. need there to dress up the quote (like add quoting marks, etc.).  When I save
  183. the file and exit the editor, the macro does an ASCII Upload of the file and
  184. deletes it.
  185.  
  186. Then the Screen Image pathname is restored to what it was before.
  187.  
  188.  Quoting macro
  189.  ───────────────────────────────────────────────────────────────────────────
  190.  {:cf6} {setv scrsav,%_scr} {screen n,%dldir\temp} {scroll}
  191.         {exec-N q %_scr} {asci %_scr}
  192.         {exec-N del %_scr} {screen n,%scrsav} {}
  193.  
  194.  
  195.                                 - end -
  196.